Skip to main content

Insights.Configinterface

Configuration for publishing io.Insights data.

Properties (17)

Property Type Default Required Description
additionalAttributes⚓︎ { [x: string]: unknown; } | (() => { [x: string]: unknown; }) x x

Additional properties to publish as part of each OpenTelemetry signal, specified as key/value pairs. You can use environment variables as values. Environment variables must start and end with a percent sign (e.g., %MyEnvVar%), and can contain a fallback value (e.g., %MyEnvVar?DefaultValue%).

additionalResourceAttributes⚓︎ { [x: string]: unknown; } | (() => { [x: string]: unknown; }) x x

Additional properties to publish as part of the OpenTelemetry resource definition for all OpenTelemetry signals, specified as key/value pairs. You can use environment variables as values. Environment variables must start and end with a percent sign (e.g., %MyEnvVar%), and can contain a fallback value (e.g., %MyEnvVar?DefaultValue%).

addResourceAttributesToAttributes⚓︎ boolean false x

Whether to add resource attributes to signal attributes.

applicationName⚓︎ string x x

Application name to use in telemetry information. By default, it's populated by io.Connect.

enabled⚓︎ boolean x

Whether library is enabled. If disabled, API is still usable, but methods are no-ops.

errorlessMode⚓︎ boolean false x

If true, the library will swallow all errors, instead of propagating them.

failOnInitError⚓︎ boolean x x

If failure to initialize library will throw upstream error.

headers⚓︎ { [x: string]: string; } | (() => { [x: string]: string; }) | (() => Promise<{ [x: string]: string; }>) x x

Additional headers to send in HTTP requests, e.g. when using HTTP exporters.

metrics⚓︎ MetricsSettings x x

Settings for publishing io.Insights metrics.

platformVersion⚓︎ string x x

If provided, this value will be added to the metrics and span attributes and to the span filtering context (see 'filters' in TracesSettings).

registerGlobalOTELObjects⚓︎ boolean | "force" true x

Whether the library should register its own instances of the OTEL SDK global objects, e.g. MeterProvider. This is useful for controlling which instance of the SDK is used, in applications that initialize their own SDK.

If true, the io.Insights library will register its own OTEL SDK global object instances if none are already registered. This means an already initialized SDK will be used in preference to the one initialized by io.Insights.

If "force", the io.Insights library will register its own OTEL SDK global object instances unconditionally, regardless of any existing registrations. This means any already initialized SDK will not be used and the library will always use its own instance.

If false, the io.Insights library will not register its own OTEL SDK global object instances. The library will require an already initialized OTEL SDK instance.

serviceId⚓︎ string x x

If provided, this value will be added to the metrics and traces service.instance.id attribute, unless an OTEL service object (e.g. TraceProvider) has been provided to the library with a different setting.

serviceName⚓︎ string x x

If provided, this value will be added to the metrics and traces service.name attribute, unless an OTEL service object (e.g. TraceProvider) has been provided to the library with a different setting.

serviceVersion⚓︎ string x x

If provided, this value will be added to the metrics and traces service.version attribute, unless an OTEL service object (e.g. TraceProvider) has been provided to the library with a different setting. attribute.

traces⚓︎ TracesSettings x x

Settings for publishing io.Insights traces.

useExistingOTELSDK⚓︎ boolean false x

If true, io.Insights publishes through the host application's own OTEL SDK instead of building providers of its own: the tracer, meter and logger providers are taken from the OTEL API globals unconditionally (the globals are never absent - unregistered APIs return proxy/noop providers, so there is no meaningful fallback).

Ordering matters: the trace and logs globals are proxies that late-bind, so signals emitted before the host registers its SDK are dropped and start flowing once it does; the metrics global is a snapshot, which io.Insights compensates for by re-resolving it per meter creation - but meters created before the host registered stay bound to the noop. Register the host SDK before initializing io.Insights for full coverage.

In this mode io.Insights registers nothing: registerGlobalOTELObjects is effectively ignored, the global propagator is whatever the host registered (header injection rides it), resource attributes come from the host's providers (io.Insights resource settings are unused), and waitForFinalExport is best-effort - flushing on shutdown is the host SDK's responsibility.

userId⚓︎ string x x

If provided, this value will be added to the metrics and traces user.id attribute, unless an OTEL service object (e.g. TraceProvider) has been provided to the library with a different setting.